{layout name="p/base" /}
    <link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css"/>
    <script type="text/javascript"
            src="http://webapi.amap.com/maps?v=1.3&key=a7e2fc1a96a83283106bf583328aa248&plugin=AMap.Autocomplete"></script>
    <script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>
<form class="form-horizontal" role="form" id='addcamp' action="/camp" method="post">
    <div class="row">
      <div class="col-lg-12">
        <h1>营地管理 <small>营地信息编辑</small></h1>
        <ol class="breadcrumb">
          <li><a href="/campmanagerlist"><i class="fa fa-dashboard"></i> 管理首页</a></li>
          <li><a href="/camp"><i class="fa fa-dashboard"></i> 营地列表信息</a></li>
          <li class="active"><i class="fa fa-table"></i> 营地信息编辑</li>
        </ol>
        <div class="alert alert-success alert-dismissable">
          <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
          请准确编辑营地信息
        </div>
      </div>
    </div>
    <!-- /.row -->
    <div class="row">
      <!-- 选项卡start -->
      <div class="bs-example">
        <!-- 选项卡标题start -->
        <ul class="nav nav-tabs" style="margin-bottom:15px;">
          <li class="active">
            <a href="#one" data-toggle="tab">营地基本信息</a>
          </li>
          <li>
            <a href="#two" data-toggle="tab">营地介绍图文信息</a>
          </li>
        </ul>
        <!-- 选项卡标题end -->
        <!-- 选项卡内容start -->
        <div id="myTabContent" class="tab-content">

          <!-- 选项卡内容1会员类型start -->
          <div id="one" class="tab-pane fade active in">
          
            <!-- 基本信息start -->
            <div class="col-lg-11">
              <!-- 营地信息start -->
              
                
                  <div class="form-group">
                    <label class="control-label col-sm-2">营地编号</label>
                    <div class="col-sm-4">
                      <input class="form-control" type="text" name="number" placeholder="sjz85468585">
                    </div>
                    <label class="control-label col-sm-2">营地名称</label>
                    <div class="col-sm-4">
                      <input class="form-control" type="text" name="name" placeholder="请填写营地名称" >
                    </div>
                  </div>
                  <div class="form-group ">
                    <label for="firstname" class="control-label col-sm-2">营地类型</label>
                    <div class="col-sm-4">
                      <select class="form-control" name="type">
                      {foreach $types as $k => $type}
                       <option value={$k}>{$type}</option>
                      {/foreach}
                      </select>
                    </div>
                    <label for="firstname" class="control-label col-sm-2">营地星级</label>
                    <div class="col-sm-4">
                    <select class="form-control" name="grade">
                      {foreach $grades as $k => $grade}
                       <option value={$k}>{$grade}</option>
                      {/foreach}
                    </select>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="control-label col-sm-2">泊位数量</label>
                    <div class="col-sm-4">
                      <input class="form-control" type="text" name="count" placeholder="请填写泊位数量">
                    </div>
                    <label class="control-label col-sm-2">营地描述</label>
                    <div class="col-sm-4">
                      <textarea class="form-control" type="text" name="profiles"  placeholder="请填写营地名称"></textarea>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="control-label col-sm-2">超级管理员账号</label>
                    <div class="col-sm-4">
                      <input class="form-control" type="text" name="campmanager_phone" placeholder="请填写超级管理员手机号码" />
                    </div>
                    <label class="control-label col-sm-2">超级管理员姓名</label>
                    <div class="col-sm-4">
                      <input class="form-control" type="text" name="campmanager_name" placeholder="请填写超级管理员姓名">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="control-label col-sm-2">营地所属分公司</label>
                    <div class="col-sm-4">
                      <select class="form-control" name="branch">
                       <option value='石家庄' >石家庄</option>
                    </select>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="control-label col-sm-2">邮箱</label>
                    <div class="col-sm-4">
                      <input class="form-control" type="text" name="email" placeholder="请填写营地负责人邮箱" />
                    </div>
                    <label class="control-label col-sm-2">营地旅行币基数</label>
                    <div class="col-sm-4">
                      <input class="form-control" type="text" name="travel_money_base" placeholder="请设置营地旅行币基数" />
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="control-label col-sm-2">法人代表</label>
                    <div class="col-sm-4">
                      <input class="form-control" type="text" name="legal_person" placeholder="请填写法人代表姓名" />
                    </div>
                    <label class="control-label col-sm-2">统一社会信用代码</label>
                    <div class="col-sm-4">
                      <input class="form-control" type="text" name="credit_code" placeholder="请填写统一社会信用代码" />
                    </div>
                  </div>
                  <div class="form-group">
                  <label for="firstname" class="control-label col-sm-2">原营地封面</label>
                  <div class="col-sm-2">
                  <img class="img-responsive"  src='###'>
                  </div>
                  </div>                
                  <!-- 上传图像start -->
                  <div class="form-group">
                    <label for="firstname" class="control-label col-sm-2">营地封面</label>
                    <!-- <div class="col-sm-10">
                      <input type="file" name="img_head" id="img_head" multiple class="file-loading" />
                    </div> -->
                  </div>
                  <!-- 上传图像end -->
                  <!-- 上传营业执照start -->
                  <div class="form-group">
                    <label for="firstname" class="control-label col-sm-2">营业执照</label>
                    <!-- <div class="col-sm-10">
                      <input type="file" name="img_head" id="img_head" multiple class="file-loading" />
                    </div> -->
                  </div>
                  <!-- 上传营业执照end -->
                  <div class="form-group" id="global_location">
                    <label class="control-label col-sm-2">地址</label>
                        <select name="country" class="country" data-first-title="选择国家" style="width:100px;"></select>
                        <select name="state" class="state" style="width:100px;" data-required="true"></select>
                        <select name="city" class="city" style="width:100px;" data-required="true"></select>
                  </div>

                  <!-- 地图start -->
                  <div class="form-group">
                    <label for="firstname" class="control-label col-sm-2">营地地图</label>
                    <div class="col-sm-10 campmap">
                    <div id="container"></div>
                    <div id="myPageTop">
                      <table>
                        <tr>
                          <td>
                            <label>按关键字搜索：</label>
                          </td>
                          <td class="column2">
                            <label>左击获取经纬度：</label>
                          </td>
                        </tr>
                        <tr>
                          <td>
                            <input type="text" placeholder="请输入关键字进行搜索" id="tipinput">
                          </td>
                          <td class="column2">
                            <input type="text" readonly="true" id="lnglat">
                            <input type="hidden" name="lng" id='lng' />
                            <input type="hidden" name="lat" id='lat' />
                          </td>
                        </tr>
                      </table>
                    </div>
                    <script type="text/javascript">
                      var map = new AMap.Map("container", {
                        resizeEnable: true,
                        
                      });
                      var marker = new AMap.Marker({
                        position: map.getCenter(),
                        draggable: true,
                        cursor: 'move',
                        raiseOnDrag: true
                    });
                     marker.setMap(map);
                    //为地图注册click事件获取鼠标点击出的经纬度坐标
                    var clickEventListener = map.on('click', function(e) {
                      document.getElementById("lnglat").value = e.lnglat.getLng() + ',' + e.lnglat.getLat();
                      document.getElementById("lng").value = e.lnglat.getLng();
                      document.getElementById("lat").value = e.lnglat.getLat();

                      marker.setPosition([e.lnglat.getLng(),e.lnglat.getLat()])
                    });                 
                    var auto = new AMap.Autocomplete({
                      input: "tipinput"
                    });
                      AMap.event.addListener(auto, "select", select);//注册监听，当选中某条记录时会触发
                      function select(e) {
                        if (e.poi && e.poi.location) {
                          map.setZoom(15);
                          map.setCenter(e.poi.location);
                          document.getElementById("lnglat").value = e.poi.location.getLng() + ',' + e.poi.location.getLat();
                          document.getElementById("lng").value = e.poi.location.getLng();
                          document.getElementById("lat").value = e.poi.location.getLat();
                          marker.setPosition([e.poi.location.getLng(),e.poi.location.getLat()])
                        }
                      }
                    </script>                

                    </div>
                  </div>


                 
            </div>

            <!-- 基本信息end -->
          </div>
          <!-- 选项卡内容1营地基本信息end -->
          <!-- 选项卡内容2营地图文信息start -->
          <div id="two" class="tab-pane fade">
            <!-- 基本信息start -->

            

            <div class="col-lg-12">
               <div class="form-group">
                    <!-- 营地信息end -->
                    <script id="editor" name="content" type="text/plain">
                        这里写你的初始化内容
                    </script>
                    <!-- 配置文件 -->
                    <script type="text/javascript" src="/UEditor/ueditor.config.js"></script>
                    <!-- 编辑器源码文件 -->
                    <script type="text/javascript" src="/UEditor/ueditor.all.js"></script>
                    <!-- 实例化编辑器 -->
                    <script type="text/javascript">
                        UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
                          UE.Editor.prototype.getActionUrl = function(action) {
                              if (action == 'uploadimage' || action == 'uploadscrawl' || action == 'uploadimage') {
                                  return 'http://manager.shsytour.lol/user/upload';
                              } else if (action == 'uploadvideo') {
                                  return 'http://a.b.com/video.php';
                              } else {
                                  return this._bkGetActionUrl.call(this, action);
                              }
                          }

                          var ue = UE.getEditor('editor',{toolbars: [[
                                  'fullscreen', 'source', '|', 'undo', 'redo', '|',
                                  'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                                  'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
                                  'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
                                  'directionalityltr', 'directionalityrtl', 'indent', '|',
                                  'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
                                  'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
                                  'simpleupload', 'insertimage', 'emotion', 'map', 'gmap', 'insertframe', 'insertcode', 'background', '|',
                                  'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
                                  'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
                                  'print', 'preview', 'searchreplace', 'drafts', 'help'
                              ]]});
                          ue.addListener('ready', function() {
                              ue.focus();
                          });

                        var ue = UE.getEditor('editor');
                    </script>
                </div>

              <div class="form-group">
                <div class="btn-group mybtn">
                  <button class="btn btn-primary" type="submit">提交</button>
                </div>
              </div>
              
            </div>
            <!-- 基本信息end -->
          </div>
          
          <!-- 选项卡内容2营地图文信息end -->
        </div>
        <!-- 选项卡内容end -->
      </div>
      <!-- 选项卡end -->
    </div>
</form>
    
<script type="text/javascript">
  $.cxSelect.defaults.url = '/static/js/cityData.json';
  $.cxSelect.defaults.emptyStyle = 'none';
  $('#global_location').cxSelect({
    url: '/static/js/globalData.json',               // 如果服务器不支持 .json 类型文件，请将文件改为 .js 文件
    selects: ['country', 'state', 'city'],  // 数组，请注意顺序
    emptyStyle: 'none'
  });
</script>



 

